﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using AiLuWeb.WebSite.Code;
using System.Collections;
using AiLuWeb.Model;
using AiLuWeb.Business;

namespace AiLuWeb.WebSite
{
    public partial class productscate : PageBase
    {
        protected int id;
        protected NewsClass curClass = new NewsClass();
        protected IList<NewsClass> newsClassList = new List<NewsClass>();
        protected INewsClassBusiness newsClassBll = new NewsClassBusinessFactory().CreateNewsClassBusiness();

        protected void Page_Load(object sender, EventArgs e)
        {
            // 获取参数
            id = QueryParamInt32("id");
            if (id > 0)
            {
                curClass = Utility.GetNewsClass().FirstOrDefault(c => c.Id == id);
                if (curClass != null)
                {
                    Hashtable ht = new Hashtable();
                    ht.Add(NewsClassHash.PId, id);
                    ht.Add(NewsClassHash.OrderDirection, "asc");
                    newsClassList = newsClassBll.GetAllNewsClass(ht);
                }
                else
                {
                    curClass = new NewsClass();
                    Page_GoTo("/404.aspx?id=4042");
                }
            }
            else
            {
                curClass = new NewsClass();
                Page_GoTo("/404.aspx?id=4041");
            }
        }
    }
}